package luj.tool.jnproxyan.proxy.network.https.client;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleUserEventChannelHandler;
import io.netty.handler.ssl.SslCompletionEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SslLogHandler extends SimpleUserEventChannelHandler<SslCompletionEvent> {

  @Override
  protected void eventReceived(ChannelHandlerContext ctx, SslCompletionEvent evt) {
    if (evt.isSuccess()) {
      LOG.debug("{}", evt);
      return;
    }

    LOG.error(evt.toString(), evt.cause());
  }

  private static final Logger LOG = LoggerFactory.getLogger(SslLogHandler.class);
}
